<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue中class绑定</title>
    <script src="./vue.js"></script>
</head>
<body>
    <div id="app" :class="[{active:isActive},errorClass]">Hello World</div>
    <div id="vm" :class="[isActive ? activeClass : 'ff',errorClass]">Hello World</div>
    
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                active:'test',
                isActive:false,
                errorClass:'1',
            },
        })
        var vm = new Vue({
            el:'#vm',
            data:{
                isActive:true,
                activeClass:'test_active',
                errorClass:'test',
            }
        })
        
    </script>
</body>
</html>